import axios from './api' // 倒入 api

/* 将所有接口统一起来便于维护
 * 如果项目很大可以将 url 独立成文件，接口分成不同的模块
 * 此处的数据依然来自 Easy Mock
 */

//  上传文件
const uploadFiles = () => {
  return axios({
    url: '/simulation/upload_file',
    method: 'post'
  })
}
//  提交表单
const submitFormTable = params => {
  return axios({
    url: '/simulation/quality_Inspection',
    method: 'post',
    data: params
  })
}
//  工艺流程展示
const upload_gongxu_file = params => {
  return axios({
    url: '/simulation/upload_gongxu_file',
    method: 'post',
    data: params
  })
}
//  关键参数识别
const keyParameter = params => {
  return axios({
    url: '/simulation/keywords_identity',
    method: 'post',
    data: params
  })
}
//  联动作用
const linkageAnalyze = params => {
  return axios({
    url: '/simulation/linkage_analyze',
    // method: 'get',
    method: 'post',
    data: params
  })
}
//  图片
const imgurl = params => {
  return axios({
    url: '/simulation/linkage_chart_data',
    method: 'get',
    params
  })
}
//  关联分析
const relationAnalysis = params => {
  return axios({
    url: '/algorithm_analyze/relation_clust_analysis',
    method: 'post',
    data: params
  })
}
//  关联分析 - Apriori
const apriori = params => {
  return axios({
    url: '/algorithm_analyze/apriori',
    method: 'post',
    data: params
  })
}
//  聚类分析
const clustAnalysis = params => {
  return axios({
    url: '/algorithm_analyze/clust_analysis',
    method: 'post',
    data: params
  })
}
//  异常检测
const abnormalAnalysis = params => {
  return axios({
    url: '/algorithm_analyze/abnormal_detection',
    method: 'post',
    data: params
  })
}
//  工序对应的参数
const operation = params => {
  return axios({
    url: '/simulation/args_last',
    method: 'get',
    params
  })
}
//  结果下载
const downloadProcess = () => {
  return axios({
    url: '/simulation/download_process',
    method: 'get'
  })
}
// 多工序-复杂网络分析 节点连接度
// const net_degree = params => {
//   return axios({
//     url: '/algorithm_analyze/net_degree',
//     method: 'post',
//     params
//   })
// }
const net_degree = params => {
  return axios({
    url: '/algorithm_analyze/net_degree',
    method: 'post',
    data: params
  })
}
//  关键参数识别 - 2019-12-10
const shap_value_key = params => {
  return axios({
    url: '/multi_process/shap_value_key',
    method: 'post',
    data: params
  })
}
//  联动作用分析 - 2019-12-10
const linkage = params => {
  return axios({
    url: '/multi_process/linkage',
    method: 'post',
    data: params
  })
}
// 工艺流程展示 - 上传文件 - 2019-12-13
const upload_rule_file = params => {
  return axios({
    url: '/multi_process/upload_rule_file',
    method: 'post',
    data: params
  })
}
//  工序对应的参数 - 2019-12-13
const get_multi_args = params => {
  return axios({
    url: '/multi_process/get_multi_args',
    method: 'get',
    params
  })
}

//  默认全部倒出
//  根绝需要进行
export default {
  uploadFiles,
  submitFormTable,
  relationAnalysis,
  apriori,
  clustAnalysis,
  abnormalAnalysis,
  imgurl,
  upload_gongxu_file,
  keyParameter,
  linkageAnalyze,
  operation,
  downloadProcess,
  net_degree,
  shap_value_key,
  linkage,
  upload_rule_file,
  get_multi_args,
}
